package com.xiumu.hazelcastwebcopy.service;

import com.xiumu.hazelcastmodel.entity.User;
import com.xiumu.hazelcastwebcopy.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    @Cacheable("allUser")
    public List<User> getAllUser(){
        return userRepository.findAll();
    }
}